home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2001 December / pcwk12201b.iso / Wersje pelne i specjalne / Winamp 2.77 i 3.0beta / wasabi-sdk_beta1.exe / studio / common / tabsheet.h < prev    next >
C/C++ Source or Header  |  2001-10-08  |  3KB  |  103 lines

  1. /*
  2.  
  3.   Nullsoft WASABI Source File License
  4.  
  5.   Copyright 1999-2001 Nullsoft, Inc.
  6.  
  7.     This software is provided 'as-is', without any express or implied
  8.     warranty.  In no event will the authors be held liable for any damages
  9.     arising from the use of this software.
  10.  
  11.     Permission is granted to anyone to use this software for any purpose,
  12.     including commercial applications, and to alter it and redistribute it
  13.     freely, subject to the following restrictions:
  14.  
  15.     1. The origin of this software must not be misrepresented; you must not
  16.        claim that you wrote the original software. If you use this software
  17.        in a product, an acknowledgment in the product documentation would be
  18.        appreciated but is not required.
  19.     2. Altered source versions must be plainly marked as such, and must not be
  20.        misrepresented as being the original software.
  21.     3. This notice may not be removed or altered from any source distribution.
  22.  
  23.  
  24.   Brennan Underwood
  25.   brennan@nullsoft.com
  26.  
  27. */
  28.  
  29. #ifndef _TABSHEET_H
  30. #define _TABSHEET_H
  31.  
  32. #include "common.h"
  33. #include "basewnd.h"
  34. #include "buttwnd.h"
  35. #include "ptrlist.h"
  36. #include "tlist.h"
  37.  
  38. class SkinBitmap;
  39.  
  40. class COMEXP TabButton : public ButtonWnd {
  41. public:
  42.   TabButton();
  43.  
  44.   virtual void onLeftPush(int x, int y);
  45.  
  46.   void linkWnd(BaseWnd *control);
  47.  
  48. private:
  49.   BaseWnd *linked;
  50. };
  51.  
  52. #define TABSHEET_PARENT BaseWnd
  53. class COMEXP TabSheet : public TABSHEET_PARENT {
  54. public:
  55.   TabSheet();
  56.   virtual ~TabSheet();
  57.  
  58.   virtual int onInit();
  59.   virtual void getClientRect(RECT *);
  60.   virtual int onPaint(Canvas *canvas);
  61.   virtual int onResize();
  62.   virtual int childNotify(RootWnd *which, int msg, int param1, int param2);
  63.  
  64.   void setTabRowHeight(int newheight);
  65.   void setTabRowMargin(int pixels);
  66.   int addChild(BaseWnd *newchild);
  67.   int addChild(BaseWnd *newchild, const char *tip);
  68.   int addChild(BaseWnd *newchild, HINSTANCE hInst, int normal, int pushed, int hilite);
  69.   int addChild(BaseWnd *newchild, HINSTANCE hInst, int normal, int pushed, int hilite, const char *tip);
  70.   int setButtonVisible(int r, BOOL state);
  71.   virtual void activateChild(BaseWnd *activechild);
  72.  
  73.   BaseWnd *enumChild(int child);
  74.   int getNumChild();
  75.   TabButton *enumButton(int button);
  76.   int getNumButton();
  77.  
  78.   void setBackgroundBmp(const char *name); //FG
  79.   SkinBitmap *getBackgroundBitmap(); //FG
  80.  
  81. protected:
  82.   // you can set these in your constructor, they will be deleted for you
  83.   ButtonWnd *leftscroll, *rightscroll;
  84.   SkinBitmap *background;
  85.  
  86. private:
  87.   int tabrowheight, tabrowwidth, tabrowmargin;
  88.   PtrList<BaseWnd> children;
  89.   PtrList<TabButton> tabs;
  90.   TList<HINSTANCE> instances;
  91.   TList<int> normal;
  92.   TList<int> pushed;
  93.   TList<int> hilite;
  94.   TList<BOOL> showed;
  95.   PtrList<char> tips;
  96.  
  97.   int tilex, tilew;
  98.  
  99.   BaseWnd *active;
  100. };
  101.  
  102. #endif
  103.